from redis import ConnectionPool

from settings import REDIS_HOST, REDIS_PORT, REDIS_DB, PASSWORD


__all__ = ['connection_pool']


if PASSWORD:
    connection_pool = ConnectionPool(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB, password=PASSWORD)
else:
    connection_pool = ConnectionPool(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB)

